package p270jp.pxv.android.viewholder;

import android.view.View;
import p014ae.View$OnClickListenerC0050b;
import p134ei.AnalyticsScreenName;
import p165fo.C3114c;
import p270jp.pxv.android.R;
import p270jp.pxv.android.event.ShowWorkMenuOnLongClickEvent;
import p270jp.pxv.android.legacy.event.ShowIllustDetailWithViewPagerEvent;
import p270jp.pxv.android.legacy.model.IllustItem;
import p270jp.pxv.android.view.MangaListItemView;

/* renamed from: jp.pxv.android.viewholder.MangaItemViewHolder */
/* loaded from: classes2.dex */
public class MangaItemViewHolder extends BaseViewHolder {
    private int dividerWidth;
    private MangaListItemView mangaListItemView;

    public MangaItemViewHolder(View view) {
        super(view);
        this.mangaListItemView = (MangaListItemView) view.findViewById(R.id.manga_list_item_view);
        this.dividerWidth = (int) Math.floor((double) view.getContext().getResources().getDimension(R.dimen.renewal_gallery_item_margin));
    }

    /* renamed from: d */
    public static /* synthetic */ void m4420d(IllustItem illustItem, View view) {
        lambda$bind$0(illustItem, view);
    }

    public static int getLayoutRes() {
        return R.layout.view_manga_item;
    }

    public static /* synthetic */ void lambda$bind$0(IllustItem illustItem, View view) {
        if (illustItem.getAllIllustList().size() > illustItem.getPosition()) {
            C3114c.m6284b().m6280f(new ShowIllustDetailWithViewPagerEvent(illustItem.getAllIllustList(), illustItem.getPosition()));
        }
    }

    public static /* synthetic */ boolean lambda$bind$1(IllustItem illustItem, View view) {
        C3114c.m6284b().m6280f(new ShowWorkMenuOnLongClickEvent(illustItem.getTarget()));
        return true;
    }

    @Override // p270jp.pxv.android.viewholder.BaseViewHolder
    public void bind(Object obj) {
        super.bind(obj);
        IllustItem illustItem = (IllustItem) obj;
        AnalyticsScreenName screenName = illustItem.getScreenName();
        if (screenName != null) {
            this.mangaListItemView.setScreenName(screenName);
        }
        this.mangaListItemView.setManga(illustItem.getTarget());
        this.mangaListItemView.setOnClickListener(new View$OnClickListenerC0050b(illustItem, 24));
        this.mangaListItemView.setOnLongClickListener(new View.OnLongClickListener() { // from class: jp.pxv.android.viewholder.i
            @Override // android.view.View.OnLongClickListener
            public final boolean onLongClick(View view) {
                return MangaItemViewHolder.lambda$bind$1(IllustItem.this, view);
            }
        });
    }
}
